.example-container {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.example-container h4 {
  margin: 0 0 15px 0;
  color: #495057;
  border-bottom: 2px solid #007bff;
  padding-bottom: 8px;
}

/* 基本表单样式 */
.form {
  background-color: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #495057;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.radio-group {
  display: flex;
  gap: 15px;
  margin-top: 5px;
}

.radio-group label {
  display: flex;
  align-items: center;
  margin-right: 15px;
  cursor: pointer;
}

.radio-group input[type="radio"] {
  margin-right: 5px;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 5px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  margin-right: 15px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 5px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.submit-btn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s;
}

.submit-btn:hover {
  background-color: #218838;
}

.reset-btn {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s;
}

.reset-btn:hover {
  background-color: #545b62;
}

.form-preview {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
}

.form-preview h5 {
  margin: 0 0 10px 0;
  color: #495057;
}

.form-preview pre {
  background-color: #f1f3f4;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 10px;
  font-size: 12px;
  color: #495057;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* 表单验证样式 */
.validation-form .form-group input.error {
  border-color: #dc3545;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

.error-message {
  display: block;
  color: #dc3545;
  font-size: 12px;
  margin-top: 5px;
}

/* 文件上传样式 */
.upload-area {
  border: 2px dashed #ced4da;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background-color: #f8f9fa;
  position: relative;
}

.upload-area:hover {
  border-color: #007bff;
  background-color: #e3f2fd;
}

.upload-area.drag-over {
  border-color: #28a745;
  background-color: #e8f5e8;
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.upload-area p {
  margin: 10px 0;
  color: #6c757d;
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-list {
  background-color: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
}

.file-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.file-list-header h5 {
  margin: 0;
  color: #495057;
}

.clear-btn {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.clear-btn:hover {
  background-color: #c82333;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #f1f3f4;
}

.file-item:last-child {
  border-bottom: none;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 500;
  color: #495057;
  margin-right: 10px;
}

.file-size {
  color: #6c757d;
  font-size: 12px;
}

.remove-file-btn {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.remove-file-btn:hover {
  background-color: #c82333;
}

/* 动态表单样式 */
.dynamic-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field-config {
  background-color: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
}

.field-config h5 {
  margin: 0 0 15px 0;
  color: #495057;
}

.field-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid #f1f3f4;
  margin-bottom: 10px;
}

.field-item:last-child {
  border-bottom: none;
}

.field-name-input {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 12px;
}

.field-item select {
  padding: 5px 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 12px;
}

.field-item label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.field-item input[type="checkbox"] {
  margin-right: 5px;
}

.remove-field-btn {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.remove-field-btn:hover {
  background-color: #c82333;
}

.add-field-btn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
}

.add-field-btn:hover {
  background-color: #218838;
}

.required {
  color: #dc3545;
  margin-left: 3px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .dynamic-form {
    grid-template-columns: 1fr;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .radio-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .checkbox-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .field-item {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .file-list-header {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
}